'''
python中的单列模式：
    
'''
class Foo:
    __instance = None
    @classmethod
    def get_instance(cls):
        if cls.__instance:
            return cls.__instance
        else:
            cls.__instance=Foo()
            return cls.__instance
        
        


obj1 =Foo.get_instance()
print(obj1)

obj2 =Foo.get_instance()
print(obj2)